package org.sean.framework.kafka.message;

import lombok.Data;
import org.sean.framework.util.GSONUtil;

import java.util.UUID;

/**
 * 唯一标志消息
 *
 * @param <V> V
 */
@Data
public class UniqueMessage<V> {
    private final String uniqueId = UUID.randomUUID().toString().replace("-", "");
    private V data;

    public UniqueMessage() {
    }

    public UniqueMessage(V data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return GSONUtil.obj2Json(this);
    }
}
